<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePlantSalesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('plant_sales', function (Blueprint $table) {
            $table->id();
            $table->integer('data_id')->default(0)->comment('关联ID');
            $table->string('sn', 100)->comment('编号');
            $table->string('name', 191)->comment('名称');
            $table->string('buyer', 100)->nullable()->comment('受让方');
            $table->float('sale_amount', 12, 4)->comment('转让金额');
            $table->string('sale_type', 20)->nullable()->comment('转让类型');
            $table->date('sale_date')->nullable()->comment('转让日期');
            $table->integer('user_id')->default(0)->comment('负责人ID');
            $table->integer('department_id')->default(0)->comment('学院ID');
            $table->string('contact_person', 100)->nullable()->comment('联系人');
            $table->string('contact_mobile', 20)->nullable()->comment('联系电话');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('plant_sales');
    }
}
